<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ include file="../../base.jsp"%>
<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>数据 - AdminLTE2定制版</title>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 页面meta /-->
</head>
<body>
<div id="frameContent" class="content-wrapper" style="margin-left:0px;">
    <!-- 内容头部 -->
    <section class="content-header">
        <h1>
            产品信息
            <small>产品详情</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="/home.do"><i class="fa fa-dashboard"></i> 首页</a></li>

            <li class="active">修改产品</li>
        </ol>
    </section>
    <!-- 内容头部 /-->

    <!-- 正文区域 -->
    <section class="content">

        <!--订单信息-->
        <div class="panel panel-default">
            <div class="panel-heading">编辑产品</div>
            <form id="editForm" action="${ctx}/baseinfo/product/update.do" method="post">
                <input type="hidden" name="id" value="${data.id}">
                <input type="hidden"  name="factoryName" id ="factoryName" value="${data.factoryName}">
                <div class="row data-type" style="margin: 0px">
                    <div class="col-md-2 title">生产厂家</div>
                    <div class="col-md-4 data">
                        <select class="form-control" name="factoryId" id="factoryInfo" onchange="document.getElementById('factoryName').value=this.options[this.selectedIndex].text">
                            <option value="">请选择</option>
                            <c:forEach items="${factoryList}" var="factory">
                                <option value="${factory.id}" ${data.factoryId eq factory.id ? "selected" : ""}>
                                        ${factory.factoryName}
                                </option>
                            </c:forEach>
                        </select>
                    </div>
                    <%--<div class="col-md-2 title">产品照片</div>
                    <div class="col-md-4 data">
                        <input type="file" class="form-control" placeholder="请选择" name="productPhoto" >
                    </div>

                    <c:if test="${not empty product.productImage && !(product.productImage eq null) }">
                        <div class="col-md-2 title">产品照片</div>
                        <div class="col-md-4 data">
                            <c:if test="${not empty product.productImage && !(product.productImage eq null) }">
                                <img src="${product.productImage}" width="300px" height="180px">
                                <input type="hidden" name="productImage" value="${product.productImage}">
                            </c:if>

                        </div>
                    </c:if>
                    <c:if test="${empty product.productImage || (product.productImage eq null) }">
                        <div class="col-md-2 title">产品照片</div>
                        <div class="col-md-4 data">
                            还没有照片
                        </div>
                    </c:if>--%>

                    <div class="col-md-2 title">包装量</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="包装量" name="packingUnit"
                               value="${data.packingUnit}">
                    </div>

                    <div class="col-md-2 title">产品名称</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="产品名称" name="productNo"
                               value="${data.productNo}">
                    </div>
                    <div class="col-md-2 title">创建人</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="创建人" name="createBy"
                               value="${data.createBy}">
                    </div>
                    <div class="col-md-2 title">创建时间</div>
                    <div class="col-md-4 data">
                        <div class="input-group date">
                            <div class="input-group-addon">
                                <i class="fa fa-calendar"></i>
                            </div>
                            <input type="text" placeholder="创建时间"  name="inputTime" class="form-control pull-right"
                                   value="<fmt:formatDate value="${data.inputTime }" pattern="yyyy-MM-dd"/>" id="datepicker">
                        </div>
                    </div>
                    <div class="col-md-2 title">数量</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="数量" name="qty"
                               value="${data.qty}">
                    </div>
                    <div class="col-md-2 title">单价</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="单价" name="price"
                               value="${data.price}">
                    </div>
                    <div class="col-md-2 title">颜色</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="颜色" name="color"
                               value="${data.color}">
                    </div>
                    <div class="col-md-2 title rowHeight2x">产品描述</div>
                    <div class="col-md-4 data  rowHeight2x">
                        <textarea class="form-control" rows="3" placeholder="产品描述"
                                  name="description">${data.description}</textarea>
                    </div>

                    <div class="col-md-2 title rowHeight2x">备注</div>
                    <div class="col-md-4 data  rowHeight2x">
                        <textarea class="form-control" rows="3" placeholder="备注"
                                  name="remark">${data.remark}</textarea>
                    </div>
                </div>
            </form>
        </div>
        <!--订单信息/-->

        <!--工具栏-->
        <div class="box-tools text-center">
            <button type="button" onclick='document.getElementById("editForm").submit()' class="btn bg-maroon">保存</button>
            <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
        </div>
        <!--工具栏/-->

    </section>
    <!-- 正文区域 /-->


</div>
<!-- 内容区域 /-->
</body>
<script src="../../plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="../../plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<link rel="stylesheet" href="../../css/style.css">
<script>
    $('#datepicker').datepicker({
        autoclose: true,
        format: 'yyyy-mm-dd'
    });
    $('#datepicker1').datepicker({
        autoclose: true,
        format: 'yyyy-mm-dd'
    });
</script>

</html>